# Copyright 2021 Ant Group Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:spu.bzl", "spu_cc_binary", "spu_cc_library")

package(default_visibility = ["//visibility:public"])

spu_cc_binary(
    name = "simple_lr",
    srcs = ["simple_lr.cc"],
    data = [
        "//examples/data",
    ],
    deps = [
        ":utils",
        "//libspu/device:io",
        "//libspu/kernel/hal:public_helper",
        "//libspu/kernel/hlo:basic_binary",
        "//libspu/kernel/hlo:basic_unary",
        "//libspu/kernel/hlo:casting",
        "//libspu/kernel/hlo:const",
        "//libspu/kernel/hlo:geometrical",
        "@com_google_absl//absl/strings",
        "@llvm-project//llvm:Support",
        "@yacl//yacl/link:factory",
    ],
)

spu_cc_library(
    name = "utils",
    srcs = ["utils.cc"],
    hdrs = ["utils.h"],
    deps = [
        "//libspu/core:context",
        "@com_google_absl//absl/strings",
        "@llvm-project//llvm:Support",
        "@yacl//yacl/link:factory",
    ],
)

spu_cc_binary(
    name = "simple_pphlo",
    srcs = ["simple_pphlo.cc"],
    deps = [
        ":utils",
        "//libspu/device:api",
        "//libspu/device:io",
        "//libspu/device/pphlo:pphlo_executor",
        "@llvm-project//llvm:Support",
    ],
)
